
Imports System.Data.SqlClient


Namespace _2bMatesSite.BO
	''' <summary>
	''' Represents a favorite user
	''' </summary>
	Public Class FavoriteUser
		Protected userID As Integer
		Protected usr As User

		Public Sub New(ByVal userID As Integer)
			usr = Nothing
			Me.userID = userID
		End Sub

		Public Sub New(ByVal dr As SqlDataReader)
			usr = New User(dr)
			userID = usr.ID
		End Sub

		Public Overloads Overrides Function GetHashCode() As Integer
			Return userID
		End Function

		Public ReadOnly Property ID() As Integer
			Get
				Return userID
			End Get
		End Property

		Public ReadOnly Property User() As User
			Get
				If usr = Nothing Then
					usr = Users.GetUserByID(userID)
				End If
				Return usr
			End Get
		End Property
	End Class
End Namespace






